<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../css/common1.css">
    <!--<link rel="stylesheet" href="../../css/bootstrap.min.css">-->
    <link rel="stylesheet" href="editItem.css">
    <link rel="stylesheet" href="../../css/plugins/select2/select2.css">
    <link href="../../js/plugins/layer1/skin/layer.css" rel="stylesheet">
    <link href="../../js/plugins/ueditor/themes/default/css/ueditor.css" rel="stylesheet">
</head>
<body>
    <div class="edit-wrap" ms-controller="container">
        <div class="edit-head">
            <div class="span220">
                <span><b>*</b>商品类别：</span>
                <select id="categoryId" class="select-w form-control-sm" :duplex="form.categoryId">
					<option value="">--请选择--</option>
					<option :attr="{value: el.id}" :for="el in @categoryList">{{el.name}}</option>
                </select>
            </div>

            <div class="span220">
                <span><b>*</b>商品品牌：</span>
                <select id="brandId" class="select-w form-control-sm" :duplex="form.brandId">
					<option value="">--请选择--</option>
					<option :attr="{value: el1.id}" :for="el1 in @brandList">{{el1.name}}</option>
                </select>
            </div>

            <div class="span220" :visible="@showErp">
                <span>商品货号：</span>
                <input type="text" class="form-control-sm titleInput" :duplex="form.code">
            </div>
			
			<div class="span110" :visible="@showErp">
				<div class="div-btn-left">
					<input type="button" class="btn-search btn btn-primary" :click="wareErpGet" :visible="form.code.length > 0" value="获取数据">
				</div>
			</div>

        </div><!--edit-head-->

        <div class="edit-tabs">
            <ul class="nav-tabs" id="navTabs">
                <li :click="changePage('page1')" :class="[(currentPage == 'page1') && 'active']">基本信息</li>
                <li :click="changePage('page2')" :class="[(currentPage == 'page2') && 'active']">商品详情</li>
                <li :click="changePage('page3')" :class="[(currentPage == 'page3') && 'active']">规格属性</li>
                <li :click="changePage('page4')" :class="[(currentPage == 'page4') && 'active']">库存预警</li>
            </ul>
            <div class="handle-btn">
                <a href="javascript:;" :click="updateDrafts">保存为草稿</a>
                <a href="javascript:;" :click="updateSubmit">提交审核</a>
                <a href="javascript:;" :click="historyBack">返回</a>
            </div>

            <div class="tab-content">
                <div class="tab-pane basic" ms-class="[(currentPage == 'page1') && 'show']">
                    <table>
                        <tr>
                            <td>
                                <div class="col-left">商品ID号</div>
                                <span :html="form.id"></span>
                            </td>
                            <td>
                                <div class="col-left"><b>*</b>商品条码</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.barcode">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left"><b>*</b>商品名称</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.name">
                            </td>
                            <td>
                                <div class="col-left">商品描述</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.wareDes">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left"><b>*</b>单价</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.priceUnit"> 元
                            </td>
                            <td>
                                <div class="col-left"><b>*</b>件规</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.numberPerBox" placeholder="请输入单箱商品数"> = 1件
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left"><b>*</b>单装单位</div>
                                <select id="unitId" class="select-w form-control-sm" :duplex="form.unitId">
									<option value="">--请选择--</option>
									<option :attr="{value: el2.id}" :for="el2 in @unitList">{{el2.name}}</option>
                                </select>
                            </td>
                            <td>
                                <div class="col-left"><b>*</b>件装价格</div>
                                <input type="text" class="form-control-sm titleInput" :duplex-number="form.priceUnit*form.numberPerBox" readonly> 元
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left"><b>*</b>净含量</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.netContent">
                            </td>
                            <td>
                                <div class="col-left"><b>*</b>件重量</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.weightPiece">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left"><b>*</b>销售站点</div>
                                <select id="saleSiteId" multiple="multiple" :duplex="form.saleSiteId">
									<option :attr="{value: el3.id}" :for="el3 in @siteList">{{el3.name}}</option>
                                </select>
                            </td>
                            <td>
                                <div class="col-left"><b>*</b>发货地</div>
                                <select id="sendProvinceId" class="select-w form-control-sm w100" :duplex="form.sendProvinceId">
									<option value="">--请选择--</option>
									<option :attr="{value: el4.id}" :for="el4 in @provinceList">{{el4.name}}</option>
                                </select>
                                <select id="sendCityId" class="select-w form-control-sm w100" :duplex="form.sendCityId">
									<option value="">--请选择--</option>
									<option :attr="{value: el5.id}" :for="el5 in @cityList">{{el5.name}}</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left"><b>*</b>起批数量</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.numberWholesale"> 件
                            </td>
                            <td>
                                <div class="col-left"><b>*</b>库存数量</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.numberInventory"> 件
                            </td>
                        </tr>
                    </table>
                    <div class="upload-wrap">
                        <div class="upload-head">
                            <div class="col-left"><b>*</b>商品主图</div>
                            (尺寸600*600px，仅支持JPG、PNG图片文件，且文件小于500KB)
                        </div>
                        <div class="upload-cont">
                            <form action="" id="form-upload" class="clearfix">
                                <label for="uploadImg">上传图片</label>
                                <input type="file" onChange="inputChange(this)" id="uploadImg" accept=".jpg,.png" />
                                <ul>
                                    <li :for="item in images"><img :attr="{src: item}"><span class="pop-delete" :click="@deleteImage(item)">删除</span></li>
                                </ul>
                            </form>
                            <p class="red-color">商品缩略图默认为第一张图进行缩减</p>
                        </div>
                    </div>
                </div><!--/基本信息-->

                <div class="tab-pane" ms-class="[(currentPage == 'page2') && 'show']">
                    <table>
                        <tr>
                            <td>
                                <div class="col-left">生产许可证</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.productionLicense">
                            </td>
                            <td>
                                <div class="col-left">执行标准</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.performStandard">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left">保质期</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.shelfLife">天
                            </td>
                            <td>
                                <div class="col-left">存储方式</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.methodStorage">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left">包装方式</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.methodPacking">
                            </td>
                            <td>
                                <div class="col-left">件装尺寸</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.sizePiece">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left">生产日期</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.dateManufacture" disabled="true">
                            </td>
                            <td>
                                <div class="col-left">产地</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.producingArea">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="col-left">生产厂家</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.manufacturer">
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>

                    <div class="detail-wrap">
                        <div class="col-left">商品详情图</div>
                        <div class="editor">
							<textarea id="description" name="description" style="min-height:60px;" :duplex="form.description"></textarea>
                        </div>
                    </div>
                </div><!--/商品详情-->
                <div class="tab-pane" ms-class="[(currentPage == 'page3') && 'show']">
                    <table>
						<tr :for="(index, el) in @form.wareAttrList">
                            <td>
                                <div class="col-left">商品属性</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="el.name">
                            </td>
                            <td>
                                <div class="col-left">关联商品ID号</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="el.wareId">
                                <a href="javascript:;" class="btn-search btn btn-primary" :click="addAttr">新增</a>
                                <a href="javascript:;" class="btn-search btn btn-primary" :visible="el.wareId != @form.id" :click="removeAttr(index)">删除</a>
                            </td>
                        </tr>
                    </table>
                </div><!--/规格属性-->

                <div class="tab-pane" ms-class="[(currentPage == 'page4') && 'show']">
                    <table>
                        <tr>
                            <td>
                                <div class="col-left">库存安全值</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.wareStockWarn.threshold"> 件
                            </td>
                            <td>
                                <div class="col-left">预警手机号</div>
                                <input type="text" class="form-control-sm titleInput" :duplex="form.wareStockWarn.noticeMobile">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">预警说明：设置库存安全值后，若库存数量低于该值将会发送短信给预警手机号</td>
                        </tr>
                    </table>
                </div><!--/库存预警-->
            </div>
        </div>
    </div>
    <script data-main="editItem" src="../../javascript/require.js"></script>
	
</body>
</html>